
const CacheCenter = require("./cacheCenter/index");
const NotificationCenter = require("./notificationCenter/index");
const LogCenter = require("./logCenter/index");
const Validator = require("./validator/index");
const Utils = require("./utils/index");
const TimeUtils = require("./timeUtils/index");
const Tools = require("./tools/index");
const Request = require("./request/index");

function registerModule(configData) {
    // 注册 缓存中心 组件
    CacheCenter.registerModule(configData.cacheConfig);
    Request.registerModule(configData.requestConfig);
}

module.exports = {
    // index
    registerModule,

    // cacheCenter
    CacheCenter,
    updateCacheData: CacheCenter.updateCacheData,
    readCacheData: CacheCenter.readCacheData,
    exportCacheTable: CacheCenter.exportCacheTable,

    // notificationCenter
    NotificationCenter,
    postNotification: NotificationCenter.postNotification,
    removeNotificationObserver: NotificationCenter.removeNotificationObserver,
    addNormalNotificationObserver: NotificationCenter.addNormalNotificationObserver,
    addLastNotificationObserver: NotificationCenter.addLastNotificationObserver,
    addFristNotificationObserver: NotificationCenter.addFristNotificationObserver,
    exportNotificationList: NotificationCenter.exportNotificationList,

    // logCenter
    LogCenter,
    getLogDataSync: LogCenter.getLogDataSync,
    getLogDataAsync: LogCenter.getLogDataAsync,
    removeLogDataWatcher: LogCenter.removeLogDataWatcher,
    log: LogCenter.log,
    logInfo: LogCenter.logInfo,
    logError: LogCenter.logError,
    logWarn: LogCenter.logWarn,
    logDebug: LogCenter.logDebug,
    logWXRealtime: LogCenter.logWXRealtime,
    logInfoWXRealtime: LogCenter.logInfoWXRealtime,
    logDebugWXRealtime: LogCenter.logDebugWXRealtime,
    logWarnWXRealtime: LogCenter.logWarnWXRealtime,
    logErrorWXRealtime: LogCenter.logErrorWXRealtime,

    // validator
    Validator,

    // utils
    Utils,
    getObjectFromUrl: Utils.getObjectFromUrl,
    appendParam: Utils.appendParam,
    callPhoneNumber: Utils.callPhoneNumber,
    privatePhone: Utils.privatePhone,
    privateName: Utils.privateName,
    privatePrice: Utils.privatePrice,
    isArray: Utils.isArray,
    isEmpty: Utils.isEmpty,
    isNotEmpty: Utils.isNotEmpty,
    compareVersion: Utils.compareVersion,
    cmp: Utils.cmp,
    getUUID: Utils.getUUID,
    getProvider: Utils.getProvider,
    checkAuthSetting: Utils.checkAuthSetting,
    openSettingView: Utils.openSettingView,
    ergodicEnum: Utils.ergodicEnum,
    getEnumValueName: Utils.getEnumValueName,
    getEnumValueIndex: Utils.getEnumValueIndex,
    getEnumNameValue: Utils.getEnumNameValue,
    getEnumNameIndex: Utils.getEnumNameIndex,
    getEnumIndexValue: Utils.getEnumIndexValue,
    getEnumIndexName: Utils.getEnumIndexName,
    analyticsMediaType: Utils.analyticsMediaType,
    px2rpx: Utils.px2rpx,
    rpx2px: Utils.rpx2px,
    subscribeMessage: Utils.subscribeMessage,
    getArrayRandomIndex: Utils.getArrayRandomIndex,

    // timeUtils
    TimeUtils,
    processDayOfWeek: TimeUtils.processDayOfWeek,
    dateFormat: TimeUtils.dateFormat,
    getDate: TimeUtils.getDate,
    stringToDate: TimeUtils.stringToDate,
    getDateModel: TimeUtils.getDateModel,
    getAssignWeekTime: TimeUtils.getAssignWeekTime,
    getDayDis: TimeUtils.getDayDis,
    getHourDis: TimeUtils.getHourDis,
    getMinDis: TimeUtils.getMinDis,
    getTimeDesc: TimeUtils.getTimeDesc,
    isHourBetween: TimeUtils.isHourBetween,
    replaceTimeT: TimeUtils.replaceTimeT,

    // tools
    Tools,
};